package rmmk.framework.gui.knnParamSelection;

import java.awt.GridLayout;

import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JSlider;
import javax.swing.SwingConstants;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class DataProportionsPanel extends JPanel{

		Logger logger = LoggerFactory.getLogger(DataProportionsPanel.class);
		private static final long serialVersionUID = 1L;
		
		JLabel dataProportionLabel;	
		JSlider dataProportion;  
		
	public DataProportionsPanel(){

		setLayout(new GridLayout(1,2,0,10));
		dataProportionLabel = new JLabel("Train data percentage");	
		dataProportionLabel.setHorizontalAlignment(SwingConstants.CENTER);

		add(dataProportionLabel);

		dataProportion = new JSlider(JSlider.HORIZONTAL,0, 100, 50);
		dataProportion.setMajorTickSpacing(20);
		dataProportion.setPaintTicks(true);
		dataProportion.setPaintLabels(true);
		
		add(dataProportion);
		
	}

	public double getDataProportionInput() {
		double trainDataProportion = dataProportion.getValue();
		return trainDataProportion;
	}
}
